import express from 'express';
import config from './helper/config';
import './database/mongo';
import ejs from 'ejs';
import apiRoutes from './routes/api';
const app = express();

app.use('/api',apiRoutes)
//设置渲染目录
app.engine('html',ejs.__express);
app.set('views',config.static_dir);
app.set('view engine', 'html'); 
app.get('/documents', (req, res) => {
  res.render('index');
});

app.listen(config.port, () => {
  console.log("serve is starting  :"+config.port);
});

